package model.components.links.link;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import model.components.nodes.node.Node;

public class Link
{	
	private String networkName;
	public String getNetworkName(){ return networkName; }
	public void setNetworkName( String networkName ){ this.networkName = networkName; }
	
	private String namePrefix;
	public String getNamePrefix(){ return namePrefix; }
	public void setNamePrefix( String namePrefix ){ this.namePrefix = namePrefix; }
	
	private int initialNumber;
	public int getInitialNumber(){ return initialNumber; }
	public void setInitialNumber( int initialNumber ){ this.initialNumber = initialNumber; }
	
	private int number;
	public int getNumber(){ return number; }
	public void setNumber( int number )
	{
		this.number = number; 
		this.setName( this.getNamePrefix() + number );
	}
	@Override
	public String toString()
	{
		return Integer.toString( this.getNumber() );
	}
	
	private String name;
	public String getName(){ return name; }
	public void setName( String name ){ this.name = name; }
	
	private int timeStamp;
	public int getTimeStamp(){ return timeStamp; }
	public void setTimeStamp( int timeStamp ){ this.timeStamp = timeStamp; }
	
	private Node firstNode;
	public Node getFirstNode(){ return firstNode; }
	public void setFirstNode( Node firstNode ){ this.firstNode = firstNode; }
	
	private Node secondNode;
	public Node getSecondNode(){ return secondNode; }
	public void setSecondNode( Node secondNode ){ this.secondNode = secondNode; }
	
	private int bandwidth;
	public int getBandwidth(){ return bandwidth; }
	public void setBandwidth( int bandwidth ){ this.bandwidth = bandwidth; }
	
	private boolean selected;
	public boolean isSelected(){ return selected; }
	public void setSelected( boolean selected ){ this.selected = selected; }
	
	private Icon icon;
	public Icon getIcon(){ return icon; }
	public void setIcon( Icon icon ){ this.icon = icon; }
	
	public Link( String networkName, String namePrefix, int identifier, int bandwidth, String icon )
	{
		this.setNetworkName( networkName );
		this.setNamePrefix( namePrefix );
		this.setNumber( identifier );
		this.setBandwidth( bandwidth );
		this.setIcon( new ImageIcon( this.getClass().getResource( icon ) ) );
	}
	
	public Link getCopy()
	{
		return null;
	}

}
